﻿using M_Bom.API.Application.Command.BomCommand;
using M_Bom_Repository.Interface;
using MediatR;

namespace M_Bom.API.Application.CommandHandler.BomCommandHandler
{
    public class BomUpdateCommandHandler : IRequestHandler<BomUpdateCommand, int>
    {
        protected readonly IBom bom;

        public BomUpdateCommandHandler(IBom bom)
        {
            this.bom = bom;
        }

        public async Task<int> Handle(BomUpdateCommand request, CancellationToken cancellationToken)
        {
            return await bom.UpdateAsync(request);
        }
    }
}
